package com.yonyougov.devops.cruxcisupport.threadlocal;

public class ErrorMessageThreadLocal {
    private static final ThreadLocal message = new ThreadLocal<String>();
    private static final ThreadLocal hasError = new ThreadLocal<Boolean>();

    public static Boolean hasError(){
        return (Boolean)(hasError.get()) == null ? false : (Boolean)(hasError.get());
    }
    public static void setMessage(String message){
        hasError.set(true);
        ErrorMessageThreadLocal.message.set(message);
    }
    public static String getMessage(){
        return (String)message.get();
    }
}
